<template>
  <div>
    <div>
      <ul>
        <li v-for="(item, ix) in selectList" :key="ix">{{ item.userName }} <el-button @click="handleDel(ix)">删除</el-button> </li>
      </ul>
    </div>
    <div>
      <el-button type="primary" @click="handleSelectUser">选择数据</el-button>
    </div>


    <pageTableDialogVue ref="pageTableDialog" @onChange="handleSelectChange" />
  </div>
</template>

<script>
import pageTableDialogVue from './pageTableDialog.vue';
export default {
  components: {
    pageTableDialogVue,
  },
  data() {
    return {
      pageDiaog: false,
      checked: true,

      selectList: [],
    };
  },
  methods: {

    handleDel(ix) {
      this.selectList.splice(ix, 1)
    },

    handleSelectChange(list) {
      this.selectList = [...list]
      console.log(this.selectList)
    },

    handleSelectUser() {
      this.$refs.pageTableDialog.initData({}, [...this.selectList])
    }
  },
};
</script>

<style>
</style>